<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>StackNode - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
		<p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → </p>
	<h1 translate="no">StackNode</h1>
		<section>
			<header>
				<div class="class-description"><p>Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow.
They are usually needed in cases like <code>If</code>, <code>Else</code>.</p></div>
			</header>
			<article>
				<div class="container-overview">
					<h2>Constructor</h2>
					<h3 class="name name-method" id="StackNode" translate="no">new <a href="#StackNode">StackNode</a><span class="signature">( parent : <span class="param-type"><a href="StackNode.html">StackNode</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Constructs a new stack node.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>parent</strong>
									</td>
									<td class="description last">
										<p>The parent stack node.</p>
										<p>Default is <code>null</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<h2 class="subsection-title">Properties</h2>
				<div class="member">
					<h3 class="name" id="isStackNode" translate="no">.<a href="#isStackNode">isStackNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
					<div class="description">
						<p>This flag can be used for type testing.</p>
						<p>Default is <code>true</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="nodes" translate="no">.<a href="#nodes">nodes</a><span class="type-signature"> : Array.&lt;<a href="Node.html">Node</a>></span> </h3>
					<div class="description">
						<p>List of nodes.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="outputNode" translate="no">.<a href="#outputNode">outputNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
					<div class="description">
						<p>The output node.</p>
						<p>Default is <code>null</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="parent" translate="no">.<a href="#parent">parent</a><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
					<div class="description">
						<p>The parent stack node.</p>
						<p>Default is <code>null</code>.</p>
					</div>
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="Case" translate="no">.<a href="#Case">Case</a><span class="signature">( &hellip;params : <span class="param-type"><a href="global.html#any">any</a></span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Represents a <code>case</code> statement in TSL. The TSL version accepts an arbitrary numbers of values.
The last parameter must be the callback method that should be executed in the <code>true</code> case.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>params</strong>
									</td>
									<td class="description last">
										<p>The values of the <code>Case()</code> statement as well as the callback method.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="Default" translate="no">.<a href="#Default">Default</a><span class="signature">( method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Represents the default code block of a Switch/Case statement.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>method</strong>
									</td>
									<td class="description last">
										<p>TSL code which is executed in the <code>else</code> case.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="Else" translate="no">.<a href="#Else">Else</a><span class="signature">( method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Represent an <code>else</code> statement in TSL.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>method</strong>
									</td>
									<td class="description last">
										<p>TSL code which is executed in the <code>else</code> case.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="ElseIf" translate="no">.<a href="#ElseIf">ElseIf</a><span class="signature">( boolNode : <span class="param-type"><a href="Node.html">Node</a></span>, method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Represent an <code>elseif</code> statement in TSL.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>boolNode</strong>
									</td>
									<td class="description last">
										<p>Represents the condition.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>method</strong>
									</td>
									<td class="description last">
										<p>TSL code which is executed if the condition evaluates to <code>true</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="If" translate="no">.<a href="#If">If</a><span class="signature">( boolNode : <span class="param-type"><a href="Node.html">Node</a></span>, method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Represent an <code>if</code> statement in TSL.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>boolNode</strong>
									</td>
									<td class="description last">
										<p>Represents the condition.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>method</strong>
									</td>
									<td class="description last">
										<p>TSL code which is executed if the condition evaluates to <code>true</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="Switch" translate="no">.<a href="#Switch">Switch</a><span class="signature">( expression : <span class="param-type"><a href="global.html#any">any</a></span>, method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Represents a <code>switch</code> statement in TSL.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>expression</strong>
									</td>
									<td class="description last">
										<p>Represents the expression.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>method</strong>
									</td>
									<td class="description last">
										<p>TSL code which is executed if the condition evaluates to <code>true</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="addToStack" translate="no">.<a href="#addToStack">addToStack</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, index : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Adds a node to this stack.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>node</strong>
									</td>
									<td class="description last">
										<p>The node to add.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>index</strong>
									</td>
									<td class="description last">
										<p>The index where the node should be added.</p>
										<p>Default is <code>this.nodes.length</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="addToStackBefore" translate="no">.<a href="#addToStackBefore">addToStackBefore</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Adds a node to the stack before the current node.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>node</strong>
									</td>
									<td class="description last">
										<p>The node to add.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
						</dl>
					</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/StackNode.js" translate="no" target="_blank" rel="noopener">src/nodes/core/StackNode.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>